package com.gj.xxl.job.core.block;

public enum ExecutorBlockStrategyEnum {

    SERIAL_EXECUTE,
    DISCARD_THIS_TIME,
    DISCARD_LAST_TIME;

    public static ExecutorBlockStrategyEnum match(String name, ExecutorBlockStrategyEnum defaultEnum) {
        if (name != null) {
            for (ExecutorBlockStrategyEnum blockStrategyEnum : ExecutorBlockStrategyEnum.values()) {
                if (name.equals(blockStrategyEnum.name())) {
                    return blockStrategyEnum;
                }
            }
        }
        return defaultEnum;
    }
}
